pacman::p_load(lazyoptcli, dplyr, magrittr)

pp <- function(opt) {
  ggp <- opt %$% read.delim(inputfile) %>%
    set_colnames(c("y", "group", "x")) %>%
    ggplot()
  col <- opt %$% lazyopt::fenge(pointcolor)
  (ggp +
    geom_point(aes(color = group, y = y, x = x), size = opt$pointsize) +
    scale_color_manual(values = col[1:((ggp$data$group) %>% unique() %>% length())])) %>% return()
}

addopt_ggplot2(matrix(c(
  "inputfile", "i", 1, "character", "inputfile path", " ",
  "pointsize", "ps", 1, "numeric", "set point size", "2",
  "pointcolor", "pc", 1, "character", "set point color", "#E41A1C:#1E90FF:#4DAF4A:#984EA3:#ADD1E5:#999999:#66CC99:#9999CC:#CC6666:#FF8C00"
), byrow = TRUE, ncol = 6),
               arg = NULL) %>%
  lazyopt_ggplot2(., pp(.), TRUE)








